<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>cesium 标点</title>
	<script src="https://cesium.com/downloads/cesiumjs/releases/1.82/Build/Cesium/Cesium.js"></script>
	<link href="https://cesium.com/downloads/cesiumjs/releases/1.82/Build/Cesium/Widgets/widgets.css" rel="stylesheet">
    <style>
        html,body,#cesiumContainer{
            padding: 0;
            margin: 0;
            width:100%;height:100%
        }
    </style>
</head>
<body>
    <div id="cesiumContainer"></div>
    <script>
        // cesium 秘钥
        Cesium.Ion.defaultAccessToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIzMTQ1MTJkOC1kODA1LTQ3ZjMtYjFiMS1lNDljNGM3NDEzMTkiLCJpZCI6MjU5LCJpYXQiOjE2MjI1NjA5OTF9.DSp0vQUYQfm1d9ffL0PjA1WgnGTnmNdh3-JEl1Aiouw';
		var viewer = new Cesium.Viewer("cesiumContainer", {
            geocoder: false,                //是否显示地名查找控件
            sceneModePicker: false,         //是否显示投影方式控件
            navigationHelpButton: false,    //是否显示帮助信息控件
            baseLayerPicker: false,         //是否显示图层选择控件
            homeButton: false,              //是否显示Home按钮
            fullscreenButton: false,        //是否显示全屏按钮    
            timeline:true,                 //时间轴控件 
            animation:true,                //动画控件 
			terrainProvider: Cesium.createWorldTerrain(),
		});
		
		// A normal b3dm tileset of photogrammetry
		var tileset = new Cesium.Cesium3DTileset({
		  url: Cesium.IonResource.fromAssetId(40866),
		});
		viewer.scene.primitives.add(tileset);
		viewer.zoomTo(tileset);
		
		var classifcationTilesetUrl =
		  "http://localhost:8080/Apps/SampleData/Cesium3DTiles/Classification/Photogrammetry/tileset.json";
		// A b3dm tileset used to classify the photogrammetry tileset
		var classificationTileset = new Cesium.Cesium3DTileset({
		  url: classifcationTilesetUrl,
		  classificationType: Cesium.ClassificationType.CESIUM_3D_TILE,
		});
		classificationTileset.style = new Cesium.Cesium3DTileStyle({
		  color: "rgba(255, 0, 0, 0.5)",
		});
		viewer.scene.primitives.add(classificationTileset);
		
		// The same b3dm tileset used for classification, but rendered normally for comparison.
		var nonClassificationTileset = new Cesium.Cesium3DTileset({
		  url: classifcationTilesetUrl,
		  show: false,
		});
		nonClassificationTileset.style = new Cesium.Cesium3DTileStyle({
		  color: "rgba(255, 0, 0, 0.5)",
		});
		viewer.scene.primitives.add(nonClassificationTileset);
		
		Sandcastle.addToggleButton("Show classification", true, function (
		  checked
		) {
		  classificationTileset.show = checked;
		  nonClassificationTileset.show = !checked;
		});
    </script>
</body>
</html>
